/*
 * File:   ParserXMLTest.cpp
 * Author: fibrizo
 *
 * Created on 14/06/2014, 02:28:54
 */

#include "ParserXMLTest.h"
#include <string>
#include <vector>
#include "../server_ParserXML.h"

using std::cout;
using std::endl;
using std::string;
using std::vector;


CPPUNIT_TEST_SUITE_REGISTRATION(ParserXMLTest);

ParserXMLTest::ParserXMLTest() {
}

ParserXMLTest::~ParserXMLTest() {
}

void ParserXMLTest::setUp() {
}

void ParserXMLTest::tearDown() {
}

void ParserXMLTest::testCargarDatos() {
    ParserXML parser;
    // carga
    vector<string> datos = {string("Batalla Final"), string("campania.jpg"), 
    string("Facil"), string("5"), string("1"), string("El Comienzo"), string("2"), 
    string("3"), string("1"), string("3"), string("5"), string("700000000100002004030050060070")};
    vector<string> nuevosDatos;
    try {
        nuevosDatos = parser.cargarDatos(string("Campania1.xml"));
    } catch (const char* e) {
        cout << e << endl;
        cout << "Agarre una excepcion" << endl;
    }
    for(unsigned int i = 0; i < nuevosDatos.size(); i++) {
        //cout << endl << nuevosDatos[i] << "\t" << datos[i] << endl; 
        CPPUNIT_ASSERT(nuevosDatos[i] == datos[i]);
    }
}
    

void ParserXMLTest::testGuardarDatos() {
    CPPUNIT_ASSERT(true);
}

